﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ProductDetail.aspx.cs" Inherits="ProductDetail" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxNewsControl" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="DisplayTable">
    <asp:FormView ID="FormView1" CssClass="FullWidth" runat="server" 
        DataSourceID="SqlDataSource1">
        <ItemTemplate>
        <div class="ProductDetail">
            <div class="FloatLeft">
                <asp:Image ID="_img" runat="server" Height="194px" Width="160px" />
            </div>
            <div class="FloatLeft" >            
                <table>
                <tr>
                    <td>
                        <h4>Tên sách: </h4></td>
                    <td >
                        <dx:ASPxLabel ID="_lblProductName" runat="server" Font-Size="Medium">
                        </dx:ASPxLabel>
                    </td>
                </tr>
                <tr>
                    <td >
                        <h4>Loại sách: </h4></td>
                    <td >
                        <dx:ASPxHyperLink ID="_lnkCategory" runat="server" Font-Size="Medium" />
                    </td>
                </tr>
                <tr>
                    <td >
                        <h4>Tác giả: </h4></td>
                    <td >
                        <dx:ASPxHyperLink ID="_lnkAuthor" runat="server" Font-Size="Medium" />
                    </td>
                </tr>
                <tr>
                    <td >
                        <h4>Nhà sản xuất: </h4></td>
                    <td >
                        <dx:ASPxHyperLink ID="_lnkPublisher" runat="server" Font-Size="Medium" />
                    </td>
                </tr>
                <tr>
                    <td >
                        <h4>Giá bìa: </h4></td>
                    <td >
                        <dx:ASPxLabel ID="_lblPrice" runat="server" Font-Size="Medium" 
                            ForeColor="#0099FF">
                        </dx:ASPxLabel>
                    </td>
                </tr>
                <tr>
                    <td >
                        <h4>Giảm: </h4></td>
                    <td >
                        <dx:ASPxLabel ID="_lblSaleOff" runat="server" Font-Size="Medium">
                        </dx:ASPxLabel>
                    </td>
                </tr>
                <tr>
                    <td >
                        <h4>Giá bán: </h4></td>
                    <td >
                        <dx:ASPxLabel ID="_lblNewPrice" runat="server" Font-Size="Medium" 
                            ForeColor="#FF0066">
                        </dx:ASPxLabel>
                    </td>
                </tr>
                    <tr>
                        <td>
                             <h4>Giá bán trên ABCBook: </h4></td>
                        <td>
                            <asp:Label ID="_lblABCBook" runat="server" Text=""></asp:Label>
                            </td>
                    </tr>
                <tr>
                    <td>
                        <h4>Số lượng mua</h4>    
                    </td>
                    <td>
                        
                        <asp:TextBox ID="_txtAmount" CssClass="AddToCartTextBox" runat="server"></asp:TextBox>
                        
                            <asp:Label ID="_lblExist" runat="server" Text="/0"></asp:Label>
                        
                        <asp:RangeValidator ID="_RangeValidatorAmount" runat="server" ErrorMessage="*" 
                            ControlToValidate="_txtAmount" MinimumValue="1" SetFocusOnError="True">Nhập cho đúng</asp:RangeValidator>
                        <asp:CompareValidator ID="CompareValidator1" runat="server" 
                            ControlToValidate="_txtAmount" ErrorMessage="*" Operator="DataTypeCheck" 
                            SetFocusOnError="True" Type="Integer">Chỉ nhập số nguyên</asp:CompareValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ErrorMessage="*" ControlToValidate="_txtAmount" SetFocusOnError="True">Nhập số lượng trước</asp:RequiredFieldValidator>
                    </td>
                </tr>
                    <tr>
                        <rt>
                        <td colspan="2">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <asp:ImageButton ID="_imgAddToCart" runat="server" 
                                        CommandArgument='<%#Eval("ProductID") %>' ImageUrl="Images/addtocart.jpg" 
                                        onclick="_lnkAddToCart_Click" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        </rt>
                    </tr>
            </table>
            </div> <!-- End .FloatLeft -->
            <div class="ProductInfo">
                <h5> <u>Mô tả sản phẩm: </u></h5>
                        <%#Eval("Description") %></td>
            </div>
        </div>
        </ItemTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_BookStoreConnectionString %>" 
        SelectCommand="SELECT * FROM [Products] WHERE ([ProductID] = @ProductID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ProductID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</div>
</asp:Content>

